# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Paulo Matias <matias.archlinux-br.org>
# Contributor: Leslie P. Polzer <polzer.gnu.org>
# Contributor: erm67 <erm67.yahoo.it>
# Contributor: Daniel J Griffiths
# Contributor: Gaetan Bisson <bisson@archlinux.org>

pkgname=djview
pkgver=4.12
pkgrel=4
pkgdesc='Viewer for DjVu documents'
arch=('loong64' 'x86_64')
url='http://djvu.sourceforge.net/djview4.html'
license=('GPL2')
depends=('qt5-base' 'djvulibre')
makedepends=('qt5-tools')
source=("https://downloads.sourceforge.net/djvu/$pkgname-$pkgver.tar.gz"
        'djvulibre-djview4.appdata.xml')
sha256sums=('5673c6a8b7e195b91a1720b24091915b8145de34879db1158bc936b100eaf3e3'
            '6527ff07bf11f3f2b7c79a97c5617d445343040ae070d18b52cfd4f91434c119')

prepare() {
  cd ${pkgname}4-$pkgver
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd ${pkgname}4-$pkgver
  ./configure --prefix=/usr --disable-nsdejavu
  make
}

package() {
  cd ${pkgname}4-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 ../djvulibre-djview4.appdata.xml "$pkgdir/usr/share/metainfo/djvulibre-djview4.appdata.xml"
  ln -s djview "$pkgdir/usr/bin/djview4"
}
